﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Configuration;

namespace WMLogistics_Dao
{
    class ConnectionHelper
    {
        private static string mysqlconnectionString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ToString();
        //private static string mysqlconnectionString = @"server=rdsv7nbqbv7nbqb.mysql.rds.aliyuncs.com;database=rdc0fzmk2w9pd42g;uid=rdc0fzmk2w9pd42g;pwd=root123;charset='utf8'";
        public  static IDbConnection OpenConnection()
        {
            MySqlConnection connection = new MySqlConnection(mysqlconnectionString);
            connection.Open();
            return connection;
        }

        public static IDbConnection OpenOldConnection(string sqlconnection)
        {
            MySqlConnection connection = new MySqlConnection(sqlconnection);
            connection.Open();
            return connection;
        }
    }
}
